import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { Awake2System, IAwake2 } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { ChildOf, FriendOf, ImplementsInterface, ObjectSystemAttribute } from "../../../../../Decorator/Decorator";
import { PlayerComponent } from "./PlayerComponent";

export enum PlayerState {
    Disconnect,
    Gate,
    Game,
}

@ChildOf(PlayerComponent)
@ImplementsInterface(IAwake2)
export class Player extends Entity implements IAwake2<number, number> {

    public AccountId: number;

    public SessionInstanceId: number;

    public UnitId: number;

    public PlayerState: PlayerState;

}

@FriendOf(Player)
@ObjectSystemAttribute()
export class PlayerAwakeSystem extends Awake2System<Player, number, number> {

    Awake(self: Player, a: number, roleId: number): void {
        self.AccountId = a;
        self.UnitId = roleId;
    }

}